using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using Utility;
using DAL;
using BUS;

public partial class Admin_MaSoSPAdd : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadData();
        }
    }
    private void LoadData()
    {
        // load CT DH
        ddl_ct.DataSource = tbChiTietDHBUS .GetAll();
        ddl_ct.DataValueField = tbChiTietDH .tbChiTietDHColumns .IDCTDH.ToString();
        ddl_ct.DataBind();
    }
    protected void btthem_dd_Click(object sender, EventArgs e)
    {
        if (txt_ms.Text != "" && txt_tt.Text != "")
        {
            tbMaSoSP  mssp = new tbMaSoSP();
            mssp.IDCTDH = int.Parse(ddl_ct.SelectedValue);
            mssp.MaSo = int.Parse(txt_ms.Text);
            mssp.TrangThai = txt_tt.Text;
            tbMaSoSPBUS.Insert_MaSoSP (mssp);
            Response.Redirect("~/Admin/MaSoSPList.aspx");
        }
    }
}
